﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model;
using BLL;
namespace ClassSystem
{
    public partial class ASPTeacherTiaoke : System.Web.UI.Page
    {
        TLBLL bll = new TLBLL();
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Label1.Text = DateTime.Now.ToLongDateString().ToString();
        }

        protected void Button1_Click(object sender, EventArgs e)
        {

            
        }

        protected void Button1_Click1(object sender, EventArgs e)
        {
            if (this.TextBox1.Text == null && this.TextBox2.Text == null && this.TextBox3.Text == null)
            {
                Response.Write("<script>alert('不能为空！')</script>");
            }
            else
            {
                TLModel DM = new TLModel();
                DM.TeacherName = this.TextBox1.Text.Trim();
                DM.TeacherEvent = this.TextBox2.Text.Trim();
                DM.LeaveTime = this.TextBox3.Text.Trim();


                if (bll.Add(DM))
                {
                    Response.Write("<script>alert('申请提交成功')</script>");
                }
                else
                {
                    Response.Write("<script>alert('申请提交失败')</script>");
                }
            }
        }
    }
    }
